package com.java83.handler;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice //声明这个是通知
public class YiChang{
    @ExceptionHandler()
    @ResponseBody
    public String handlerException(Exception e){
        System.out.println(e+"1");
        return /*"服务器正在维护，因为发生了"*/"nicuole"+e.getMessage();
    }
}
